home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / Apple Game Sprockets / NetSprocket / NewNSpTest Sources / App.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-09-18  |  3.9 KB  |  180 lines  |  [TEXT/CWIE]

  1. /***********************************************************************
  2. #
  3. #        App.h
  4. #
  5. #        This file contains the constants and structure definitions.
  6. #
  7. #        Author: Michael Marinkovich
  8. #                Apple Developer Technical Support
  9. #
  10. #
  11. #        Modification History: 
  12. #
  13. #            6/4/95        MWM     Initial coding                     
  14. #            10/12/95    MWM        cleaned up
  15. #
  16. #        Copyright © 1992-95 Apple Computer, Inc., All Rights Reserved
  17. #
  18. #
  19. ***********************************************************************/
  20. #pragma once
  21.  
  22. #include <QDOffscreen.h>
  23.  
  24.  
  25. //---------------------------------------------------------------------
  26. //
  27. //    Macros
  28. //
  29. //---------------------------------------------------------------------
  30.  
  31. #define MIN(x,y)            ( ((x)<(y)) ? (x) : (y) )
  32. #define MAX(x,y)            ( ((x)>(y)) ? (x) : (y) )
  33. #define TopLeft( r )        ( *(Point *) &(r).top )
  34. #define BotRight( r )        ( *(Point *) &(r).bottom )
  35.  
  36.  
  37. //---------------------------------------------------------------------
  38. //
  39. //    General
  40. //
  41. //---------------------------------------------------------------------
  42.  
  43. #define kMinHeap            300 * 1024
  44. #define kMinSpace            300 * 1024
  45.  
  46.  
  47. //---------------------------------------------------------------------
  48. //
  49. //    Menus
  50. //
  51. //---------------------------------------------------------------------
  52.  
  53. #define rMBarID                128
  54.  
  55. enum {
  56.      mApple                    = 128,
  57.     iAbout                    = 1,
  58.  
  59.     mFile                    = 129,
  60.     iHost                    = 1,
  61.     iJoin                    = 2,
  62.     iLeave                    = 3,
  63.     iQuit                    = 5
  64. };
  65.  
  66.  
  67. //---------------------------------------------------------------------
  68. //
  69. //    Window stuff
  70. //
  71. //---------------------------------------------------------------------
  72.  
  73. // doc types
  74. enum {
  75.     kDocKind                = 94,
  76.     kDialogKind                = 95,
  77.     kFloatKind                = 96,
  78.     kAboutKind                = 97
  79. };    
  80.  
  81. #define kFudgeFactor        4        // fudge factor for boundary around window
  82. #define kTitleBarHeight        18        // title bar height
  83.  
  84. // scroll values
  85. #define kScrollWidth        15
  86. #define kScrollDelta        16
  87.  
  88.  
  89. //---------------------------------------------------------------------
  90. //
  91. //    General resource ID's
  92. //
  93. //---------------------------------------------------------------------
  94.  
  95. #define rAboutPictID        3000 // about picture
  96. #define rErrorDlg            128     // main error dialog
  97.  
  98.  
  99. //---------------------------------------------------------------------
  100. //
  101. //    Alert Error ID's
  102. //
  103. //---------------------------------------------------------------------
  104.  
  105. #define kNeedsDisplayManager        128    // ID of no Display Manager
  106.  
  107.  
  108. //---------------------------------------------------------------------
  109. //
  110. //    Custom Event Proc stuff
  111. //
  112. //---------------------------------------------------------------------
  113.  
  114. enum {
  115.     kIdleProc            = 1,
  116.     kMenuProc,
  117.     kInContentProc,
  118.     kInGoAwayProc,
  119.     kInZoomProc,
  120.     kInGrowProc,
  121.     kMUpProc,
  122.     kKeyProc,
  123.     kActivateProc,
  124.     kUpdateProc
  125. };
  126.     
  127.  
  128. //---------------------------------------------------------------------
  129. //
  130. //    Typedefs
  131. //
  132. //---------------------------------------------------------------------
  133.  
  134. // event handling proc
  135. typedef void (*CustomProc)(WindowRef window, void *refCon);
  136.  
  137.  
  138. // we just use the basic events for the callback procs
  139.  
  140. struct DocRec
  141. {    
  142.     CustomProc                    idleProc;            // custom idle proc
  143.     CustomProc                    mMenuProc;            // custom menu proc
  144.     CustomProc                    inContentProc;        // custom content click Proc
  145.     CustomProc                    inGoAwayProc;        // custom inGoAway proc
  146.     CustomProc                    inZoomProc;            // custom inZoom proc
  147.     CustomProc                    inGrowProc;            // custom inGrow proc
  148.     CustomProc                    mUpProc;            // custom mouseUp proc
  149.     CustomProc                    keyProc;            // custom autoKey-keyDown proc
  150.     CustomProc                    activateProc;        // custom activate window proc
  151.     CustomProc                    updateProc;            // custom window update proc
  152.     ControlRef                    hScroll;            // horz scroll bar
  153.     ControlRef                    vScroll;            // vert scroll bar
  154.     GWorldPtr                    world;                // offscreen for pict imaging
  155.     PicHandle                    pict;                // windows picture
  156. //    THPrint                        printer;            // apps print record - inited at window int
  157.     Boolean                        dirty;                // document needs saving
  158. };
  159.  
  160. typedef struct DocRec DocRec;
  161. typedef DocRec *DocPtr, **DocHnd;
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.